﻿#if NET35

//为接口统一,定义与 netstandard2.0环境下Microsoft.Extensions.Logging.ILogger 相同的接口及操作 

using System;

namespace Kernelx.Common.Logging
{
    /// <summary>
    /// 为接口统一,定义与 Net5.0环境下Microsoft.Extensions.Logging.ILogger 相同的接口
    /// </summary>
    public interface ILogger
    {

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TState"></typeparam>
        /// <param name="logLevel"></param>
        /// <param name="eventId"></param>
        /// <param name="state"></param>
        /// <param name="exception"></param>
        /// <param name="formatter"></param>
        void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="logLevel"></param>
        /// <returns></returns>
        bool IsEnabled(LogLevel logLevel);


        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TState"></typeparam>
        /// <param name="state"></param>
        /// <returns></returns>
        IDisposable BeginScope<TState>(TState state);
    }


    /// <summary>
    ///   A generic interface for logging where the category name is derived from the specified
    ///   TCategoryName type name. Generally used to enable activation of a named Microsoft.Extensions.Logging.ILogger
    ///   from dependency injection.
    /// </summary>
    /// <typeparam name="TCategoryName">   The type who's name is used for the logger category name.</typeparam>
    public interface ILogger<out TCategoryName> : ILogger { }


}
#endif